package cn.mediinfo.dianzidp.util;


public class SendUtil {
   public void main(String[] args) {
        System.out.println();
    }
//   public static String addRightSpaces(String str, int n) {
//        return StringUtils.rightPad(str, str.length() + n);
//    }
//   public static String addLeftSpaces(String str, int n) {
//        return StringUtils.leftPad(str, str.length() + n);
//    }
   public static String getKongGeSpaces(int num){
        String res = "";
        for (int i = 0; i < num; i++) {
            res = res + " ";
        }
        return res;
    }

    /**
     * 计算长度方式
     * @param str
     * @return
     */
    public static int getStrLength(String str) {
        int length = 0;
        for (char c : str.toCharArray()) {
            if (Character.UnicodeScript.of(c) == Character.UnicodeScript.HAN) {
                length = length + 2;
            }else{
                length = length + 1;
            }
        }
        return length;
    }
}
